import Vue from 'vue'
import VueRouter from 'vue-router'
//引入Login组件
import Login from '../components/Login'
//引入Home组件
import Home from '../components/Home'
//菜单组件
import userManage from '../components/menu/userManage'
import productManage from '../components/menu/productManage'
import bannerPicture from '../components/menu/bannerPicture'
import rotationMap from '../components/menu/rotationMap'
import articleContent from '../components/menu/articleContent'
import articleType from '../components/menu/articleType'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/login' //重定向
  },
  {
    path:'/login',
    component:Login
  },
  {
    path:'/home',
    component:Home,
    redirect:'/userManage',
    children:[
      {
        path:'/userManage',
        component:userManage
      },
      {
        path:'/productManage',
        component:productManage
      },
      {
        path:'/bannerPicture',
        component:bannerPicture
      },
      {
        path:'/rotationMap',
        component:rotationMap
      },
      {
        path:'/articleContent',
        component:articleContent
      },
      {
        path:'/articleType',
        component:articleType
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
